import vue from 'rollup-plugin-vue';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import autoprefixer from 'autoprefixer';
import scss from 'rollup-plugin-scss';
import json from '@rollup/plugin-json';
import image from '@rollup/plugin-image';

export default {
  input: 'src/wrapper.js',
  output: {
    exports: 'named',
    name: 'ezTable',
    format: 'umd'
  },
  plugins: [
    commonjs(),
    nodeResolve(),
    json(),
    image(),
    vue({
      css: true,
      compileTemplate: true,
      style: {
        postcssPlugins: [autoprefixer()]
      }
    }),
    scss({
      output: 'dist/ez-table.css',
      outputStyle: 'compressed',
      include: ['src/**/*.scss'],
      failOnError: true
    }),
    babel({
      babelHelpers: 'runtime',
      exclude: 'node_modules/**'
    })
  ]
};
